# Contributor: Nicolas Lorin <androw95220@gmail.com>
# Maintainer: Michał Adamski <michal@ert.pl>
pkgname=electrs
pkgver=0.10.4
pkgrel=0
pkgdesc="Efficient re-implementation of Electrum Server in Rust"
url="https://github.com/romanz/electrs"
license="MIT"
# s390x, riscv64: limited by rust/cargo
# armhf, armv7, x86: limited by rocksdb
arch="all !s390x !riscv64 !armhf !armv7 !x86"
makedepends="
	cargo
	cargo-auditable
	clang15-libclang
	linux-headers
	rocksdb-dev<7.10
	rustfmt
	"
source="https://github.com/romanz/electrs/archive/v$pkgver/electrs-$pkgver.tar.gz"

build() {
	ROCKSDB_INCLUDE_DIR=/usr/include ROCKSDB_LIB_DIR=/usr/lib cargo auditable build --all --features "metrics_process" --release --locked
}

check() {
	cargo test --all --release --locked
}

package() {
	install -Dm755 target/release/$pkgname -t "$pkgdir"/usr/bin
}

sha512sums="
346366e8f661e54036daaf9d650de065fab9726e8b080a3a6bc9b366875567e6cf9da8ac2f2c84b36943404bc9827a159b0f9abf64c355b6e34735cdb1b60bec  electrs-0.10.4.tar.gz
"
